package com.autumn.mybatis.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.autumn.mybatis.mapper.annotation.ComplexIndex;
import com.autumn.mybatis.mapper.annotation.ComplexIndexs;
import com.autumn.mybatis.mapper.annotation.Index;
import com.autumn.mybatis.mapper.annotation.TableOrderBy;

/**
 * 用户信息
 * 
 * @author 杨昌国
 *
 *         2017-09-27 17:16:09
 */
@Entity
@Table(name = "Users")
@TableOrderBy(value = "name asc,id desc")
@ComplexIndexs(indexs = { @ComplexIndex(propertys = { "age", "name" }, unique = true) })
public class UserInfo extends UserBase {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "UserId")
	@Index
	@Override
	public int getId() {
		return super.getId();
	}

	@Override
	public void setId(int id) {
		super.setId(id);
	}

	@Column(name = "UserName")
	private String name;

	private Integer age;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Index
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

}
